﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using Terraria.UI;

namespace Terraria.GameContent.UI.Elements
{
	// Token: 0x020003E9 RID: 1001
	public class UIHeader : UIElement
	{
		// Token: 0x17000288 RID: 648
		// (get) Token: 0x0600237C RID: 9084 RVA: 0x000191D3 File Offset: 0x000173D3
		// (set) Token: 0x0600237D RID: 9085 RVA: 0x00478728 File Offset: 0x00476928
		public string Text
		{
			get
			{
				return this._text;
			}
			set
			{
				if (this._text != value)
				{
					this._text = value;
					Vector2 vector = Main.fontDeathText.MeasureString(this.Text);
					this.Width.Pixels = vector.X;
					this.Height.Pixels = vector.Y;
					this.Width.Precent = 0f;
					this.Height.Precent = 0f;
					this.Recalculate();
				}
			}
		}

		// Token: 0x0600237E RID: 9086 RVA: 0x000191DB File Offset: 0x000173DB
		public UIHeader()
		{
			this.Text = "";
		}

		// Token: 0x0600237F RID: 9087 RVA: 0x000191EE File Offset: 0x000173EE
		public UIHeader(string text)
		{
			this.Text = text;
		}

		// Token: 0x06002380 RID: 9088 RVA: 0x004787A4 File Offset: 0x004769A4
		protected override void DrawSelf(SpriteBatch spriteBatch)
		{
			CalculatedStyle dimensions = base.GetDimensions();
			DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, Main.fontDeathText, this.Text, new Vector2(dimensions.X, dimensions.Y), Color.White);
		}

		// Token: 0x04003FC4 RID: 16324
		private string _text;
	}
}
